package ${packageName}.entity;
import org.apache.ibatis.type.JdbcType;
import tk.mybatis.mapper.annotation.ColumnType;

import javax.persistence.Table;
<#assign importDate=false />
<#assign importId=false />
<#list table.columns as column>
    <#if column.primaryKey>
        <#assign importId=true />
    </#if>
    <#if column.fieldType == 'Date'>
        <#assign importDate=true />
    </#if>
</#list>

<#if importId>
import javax.persistence.Id;
</#if>
<#if importDate>
import java.util.Date;
</#if>

import org.apache.ibatis.type.JdbcType;
import tk.mybatis.mapper.annotation.ColumnType;

import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;

@Table(name = "${table.tableName}")
public class ${table.className}Entity{

<#list table.columns as column>
    /**
     * ${column.filedComment}
     */
    <#if column.primaryKey>
    @Id
    </#if>
    <#if column.fieldType == 'String'>
    @ColumnType(jdbcType = JdbcType.VARCHAR)
    </#if>
    <#if column.fieldType == 'Date'>
    @ColumnType(jdbcType = JdbcType.TIMESTAMP)
    </#if>
    <#if column.fieldType == 'Long'>
    @ColumnType(jdbcType = JdbcType.INTEGER)
    </#if>
    <#if column.fieldType == 'Integer'>
    @ColumnType(jdbcType = JdbcType.INTEGER)
    </#if>
    private ${column.fieldType} ${column.fieldName};
</#list>

<#list table.columns as column>
    /**
     * 获取${column.filedComment}
     *
     * @return ${column.fieldName} - ${column.filedComment}
     */
    public ${column.fieldType} get${column.fieldName?cap_first}(){
        return this.${column.fieldName};
    }

    /**
     * 设置${column.filedComment}
     *
     * @param ${column.fieldName} ${column.filedComment}
     */
    public void set${column.fieldName?cap_first}(${column.fieldType} ${column.fieldName}){
        this.${column.fieldName} = ${column.fieldName};
    }
    </#list>
}
